﻿using Mirror;
using UnityEngine;
namespace NetTest
{
    public class Weapon:MonoBehaviour
    {
        private BoxCollider _collider; 
        private void Start()
        {
            _collider = GetComponent<BoxCollider>();
        }

        public void SetCollider(bool active) 
        {
            _collider.enabled = active;
        }
        
        //[ServerCallback]
        //private void OnTriggerEnter(UnityEngine.Collider other)
        //{
        //    Debug.Log("Trigger");
        //    if(other.TryGetComponent<PlayerScript>(out var player)) 
        //    {
        //        Debug.Log(player.name+":"+player.netIdentity);
        //        //if (player.Hurted) { return; }
        //        player.GetDamage(1);
        //    }
        //}
    }
}
